package com.chen.recruit.controller;

import com.chen.recruit.common.annotation.Log;
import com.chen.recruit.common.api.CommonResult;
import com.chen.recruit.common.enums.BusinessType;
import com.chen.recruit.common.valid.AddGroup;
import com.chen.recruit.common.valid.UpdateGroup;
import com.chen.recruit.domain.model.PageQuery;
import lombok.RequiredArgsConstructor;

import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.*;

import cn.dev33.satoken.annotation.SaCheckPermission;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import com.chen.recruit.domain.vo.DeliverResumeVo;
import com.chen.recruit.service.ResumeDeliverService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Api(tags = "投递简历管理 DeliverResumeController")
@RequiredArgsConstructor
@RestController
@RequestMapping("/recruit/deliverResume")
public class ResumeDeliverController {

    private final ResumeDeliverService resumeDeliverService;

    @ApiOperation("新增投递简历")
    @SaCheckPermission("recruit:deliverResume:add")
    @Log(module = "招聘管理-投递简历", businessType = BusinessType.INSERT)
    @PostMapping
    public CommonResult add(@Validated(AddGroup.class) @RequestBody DeliverResumeVo deliverResumeVo) {
        return null;
    }

    @ApiOperation("删除投递简历")
    @SaCheckPermission("recruit:deliverResume:delete")
    @Log(module = "招聘管理-投递简历", businessType = BusinessType.DELETE)
    @DeleteMapping("/{deliverResumeIds}")
    public CommonResult delete(@NotEmpty(message = "主键不能为空") @PathVariable Integer[] deliverResumeIds) {
        return null;
    }

    @ApiOperation("更新投递简历")
    @SaCheckPermission("recruit:deliverResume:update")
    @Log(module = "招聘管理-投递简历", businessType = BusinessType.UPDATE)
    @PutMapping
    public CommonResult update(@Validated(UpdateGroup.class) @RequestBody DeliverResumeVo deliverResumeVo) {
        return null;
    }

    @ApiOperation("获取投递简历详细信息")
    @SaCheckPermission("recruit:deliverResume:get")
    @GetMapping("/{deliverResumeId}")
    public CommonResult getInfo(@NotNull(message = "主键不能为空") @PathVariable("deliverResumeId") Integer deliverResumeId) {
        return null;
    }

    @ApiOperation("查询投递简历列表")
    @SaCheckPermission("recruit:deliverResume:list")
    @GetMapping("/list")
    public CommonResult list(DeliverResumeVo deliverResumeVo, PageQuery pageQuery) {
        return null;
    }

    @ApiOperation("导出投递简历列表")
    @SaCheckPermission("recruit:deliverResume:export")
    @Log(module = "招聘管理-投递简历", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response) {
//        List<DeliverResumeVo> list = deliverResumeService.queryList(bo);
//        ExcelUtil.exportExcel(list, "投递简历", DeliverResumeVo.class, response);
    }

}
